import { createApp } from "vue";
import "normalize.css";
import "./assets/css/index.less";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import global from "./global";

import App from "./App.vue";
import router from "./router";
import store from "./store";

import { reloadMainPage } from "./store";

const app = createApp(App);
global(app);
app.use(store);
// 如果用户已经登录了，在某个页面刷新了一下，vuex中的数据会消失
// 重新获取数据
// 先注册路由，再匹配路由，防止404
reloadMainPage();
app.use(router);

app.use(ElementPlus, {
  locale: zhCn
});

app.mount("#app");
